Part Number Hot Search : 
26102 18LACY H838524 AP432AYL ABX0027T 74FCT1 15CTQ040 18LACY
Product Description
Full Text Search
 

To Download AN597 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  1995 microchip technology inc. ds00597a-page 1 figure 1: ranging module interface binh init echo transmit polaroid 6500 ranging module re1 re0 ccp1 pic16c74 transducer introduction object ranging is essential in many types of systems. one of the most popular ranging techniques is ultrasonic ranging. ultrasonic ranging is used in a wide variety of applications including: auto focus cameras motion detection robotics guidance proximity sensing object ranging this application note describes a method of interfacing pic16cxx microcontrollers to the polaroid 6500 ranging module. this implementation uses a minimum of microcontroller resources, a ccp module and two i/o pins. the two major components of the system are: microcontroller polaroid 6500 ranging module the microcontroller performs the intelligence and arithmetic functions for ultrasonic ranging, while the polaroid 6500 ranging module performs the ultrasonic signal transmissions and echo detection. author: robert schreiber logic products division theory of operation ultrasonic ranging entails transmitting a sound wave and measuring the time that it takes for the sound wave to re?ct off of an object and back to the origin. the re?ction time is proportional to the distance that the object is from the source. in this implementation, the sound wave is transmitted and received from the same transducer. therefore, a blanking interval is required between signal transmission and reception to eliminate false echoes (i.e., a transmitted signal being detected as its own echo). circuit configuration in this implementation, a pic16c74 is connected to the ranging module as shown in figure 1. the re0 and re1 i/o pins are con?ured as digital outputs and are tied to init and binh, respectively. the ccp1 pin is con?ured as a digital input and is tied to echo through a pull-up resistor. the pull-up resistor is needed since the echo signal is an open-collector output. the ccp1 pin is con?ured for capture mode (ccp1con). figure 2 shows the timing relationship for v dd and the three signal lines (init, binh, and echo). note: the ranging module requires 5.0 millisec- onds to stabilize during power-up. AN597 implementing ultrasonic ranging thi d t t d ith f m k 4 0 4
AN597 ds00597a-page 2 1995 microchip technology inc. figure 2: timing diagram of ranging module control lines parameter number symbol characteristic min typ max units 1 tpu ranging module stabilization time 5.0 ms 2t binh blank inhibit time 0.9 2.38 ms 3t echo echo time 4t init_h high time for init 100 ms 5t init_l low time for init 100 ms 3 2 4 5 1 v dd init binh echo 3 2 the pic16c74 is con?ured to use one of its internal timers, timer1, in capture mode to measure the time between signal transmission and echo detection. the resolution of the timer is determined by the microcontroller clock frequency. for this application, a 4 mhz external oscillator was used, giving a resolution of 1 ms per bit. the pic16c74 initiates a ranging cycle by ?st clearing timer1. timer1 is then enabled and init is immediately asserted on the ranging module. when init is asserted, the ranging module transmits a series of 16 pulses on the transducer at 49.4 khz. the transmitted pulses re?ct off the object and are received back at the transducer. the transducer is used for both transmitting and receiving sound waves. a blanking interval is needed to ensure that the transmitted signal has decayed on the transducer, in order not to receive false echoes. in normal operation, the ranging module has a blanking interval of 2.38 milliseconds, which corresponds to a minimum detection distance of approximately 17 inches. however, the binh (blank inhibit) signal can be manipulated to reduce the blanking time on the transducer to allow for object ranging as close as 6 inches. in this implementation, the pic16c74 asserts the binh signal approximately 0.9 milliseconds after signal transmission. this enables the transducer to receive re?ctions off objects at a distance of 6 inches. the ranging module asserts the echo signal when a valid re?ction has been detected. the pic16c74 uses the echo signal to trigger a capture of the timer1 value. the capture register contains the 16-bit value representing the elapsed time between signal transmission and echo detection. the pic16c74 then calculates object distance based on the timer1 value, microcontroller clock speed, and the velocity of sound in the atmosphere. the basic equation for calculating distance is given below: distance (inches) = t echo time / 147.9 microseconds design considerations there are several design considerations which must be taken into account and are listed below. the absolute measuring distance supported by the ranging module is 6 inches to 35 feet with an accuracy of +/- 1%. the distance output from the ranging module can be averaged over time to ?ter distance calculations. in some applications, the gain of the receiver ampli?r may be too low or too high and may need to be adjusted. for example, if the transducer is mounted in a cylinder, the gain may need to be lowered to reduce false echoes within the cylinder. in this case, r1 (refer to the polariod ultrasonic ranging system manual) may be replaced with a 20 k w potentiometer to tweak the gain of the receiver ampli?r to reduce false echoes. in order for the polaroid 6500 ranging module to operate properly, the power supply must be capable of handling high current transients (2.5 a) during the note: the minimum high and low time for init is 100 milliseconds, as seen in figure 2.
1995 microchip technology inc. ds00597a-page 3 AN597 transmit pulse. the instantaneous drain on the power supply can be mitigated by installing a storage capacitor across the power lines at the ranging module. a value of 500 microfarads is recommended. a 200 millisecond interval is recommended between ranging cycles (figure 2) to allow the transducer to clear. the echo line requires a pull-up resistor (4.7 k w was used in this application). there must be a common ground between the pic16c74 circuitry and the ranging module. some applications may not need the resources of the higher end pic16cxx devices. it is still possible to do this application using a device that does not contain a ccp module (for echo timing). the capture function can be implemented in ?mware. the effect of a ?mware implementation is that the resolution of the echo time would be 3 tcy cycles versus 1 tcy cycle for the ccp module. also, the ?mware implementation would not allow other tasks to be performed while the capture function was occurring. refer to appendix a for general ranging module speci?ations.
AN597 ds00597a-page 4 1995 microchip technology inc. appendix a: polaroid module specifications design considerations in ultrasonics range: (with user custom designed processing electronics) f ar ther a) use an acoustic horn to ?ocus the sound (narrowing the beamwidth). b) use two transducers ?1 receiver and 1 transmitter ?facing each other. c) lower the transmitting frequency (which will decrease the attenuation in air). closer a) use a shorter transmit signal (such as four cycles). a) use two transducers ?one to transmit, one to receive (eliminates waiting for damping time). note: this appendix contains general speci?a- tions from the polaroid ultrasonic ranging system manual. please refer to the current polaroid ultrasonic ranging system manual for current information regarding ranging module design considerations. resolution a) above all, know the target and range well, and design a system with them in mind. b) use a higher transmit frequency. c) look at phase differences of a given cycle of the transmitted signal and received echo (as opposed to using and integration technique). d) increase the clock frequency of the timer. accuracy: (again, you must have a well de?ed target) t emper ature compensate a) use a second small target, as a reference, at a known distance in the ranging path (such as a 1/4 rod several feet away), process both echoes, then normalize the second distance with respect to the ?st, since t1/d1 = t2/d2. b) incorporate a temperature sensing integrated circuit to drive a vco to do the distance interval clocking. c) to increase sensitivity of detection circuit change the value of c4 from 3300 pf to 1000 pf on the 6500 series ranging module. beam width: increase a) use an acoustic lens (to disperse the signal). b) decrease the transmitting frequency. c) use several transducers to span an area. decrease a) use an acoustic horn (to focus the sound). b) increase the transmitting frequency. table 1: recommended operating conditions min. max. unit supply voltage, v cc 4.5 6.8 v high-level input voltage, v ih binh, init 2.1 v low-level input voltage, v il binh, init 0.6 v echo and osc output voltage 6.8 v delay time, power up to init high 5 ms recycle period 80 ms operating free-air temperature, t a 040 c
1995 microchip technology inc. ds00597a-page 5 AN597 table 2: electrical characteristics over recommended ranges of supply voltage and operating free-air temperature (unless otherwise noted) parameter test conditions min. typ. max. unit input current binh, init v1 = 2.1v 1 ma high-level output current, i oh echo, osc v oh = 5.5v 100 m a low-level output voltage, v ol echo, osc i ol = 1.6 ma 0.4 v transducer bias voltage t a = 25 c 200 v transducer output voltage (peak-to-peak) t a = 25 c 400 v number of cycles for xdcr output to reach 400v c= 500 pf 7 internal blanking interval 2.38* ms frequency during 16-pulse trans- mit period osc output 49.4* khz xmit output 49.4* frequency after 16 pulse transmit period osc output 93.3* khz xmit output 0 supply current, i cc during transmit period 2000 ma after transmit period 100 * these typical values apply for a 420 khz ceramic resonator.
AN597 ds00597a-page 6 1995 microchip technology inc. appendix b: firmware listing mpasm 01.02 released xdcr.asm 11-14-1994 9:29:15 page 1 loc object code line source text value 0001 ; xdcr.asm 0002 ; 0003 ; this routine continually executes ranging cycles in the 0004 ; following order: 0005 ; 0006 ; 1) timers and flags are cleared 0007 ; 2) ranging cycle executes 0008 ; 3) distance is calculated (to 0.5 inch) 0009 ; 4) hw is re-initialized for next cycle 0010 ; 0011 ; the processor uses a 4mhz oscillator, so all timing 0012 ; calculations are referenced to that. the calculated 0013 ; distance is a 16-bit result in the accbhi:accblo registers. 0014 ; 0015 0016 list p=16c74, f=inhx8m 0017 ; 0029 0030 ;****************** 0031 ; bank 0 registers 0032 ;****************** 0033 ; 0034 ; tmr1 is off, prescaler is 1 for a capture timeout of 65 msec 0000 0190 0035 clrf t1con 0036 ; set to capture on every rising edge 0001 3005 0037 movlw 0x05 0002 0097 0038 movwf ccp1con 0039 ; clear the ports 0003 0185 0040 clrf port_a 0004 0186 0041 clrf port_b 0005 0187 0042 clrf port_c 0006 0188 0043 clrf port_d 0007 0189 0044 clrf port_e 0045 ; 0046 ;****************** 0047 ; bank 1 registers 0048 ;****************** 0049 ; 0008 1683 0050 bsf status,rp0 ; set rp0 0051 ; port a is digital, port e is digital 0009 3007 0052 movlw 0x07 000a 009f 0053 movwf adcon1 0054 ; configure ccp1 (rc2) as an input, and all other ports 0055 ; as outputs, (re0 = init, re1 = binh) 000b 0185 0056 clrf tris_a 000c 0186 0057 clrf tris_b 000d 3004 0058 movlw 0x04 000e 0087 0059 movwf tris_c 000f 0188 0060 clrf tris_d 0010 0189 0061 clrf tris_e 0011 1283 0062 bcf status,rp0 ; clear rp0 0012 0063 xdcr 0064 ; 0065 ; initialize timers and flags 0066 ; 0012 1010 0067 bcf t1con,0 ; disable tmr1 0013 018c 0068 clrf pir1 ; clear timer1 overflow flag & timer1 capture flag please check the microchip bbs for the latest version of the source code. for bbs access information, see section 6, microchip bulletin board service information, page 6-3.
1995 microchip technology inc. ds00597a-page 7 AN597 0014 018e 0069 clrf tmr1l ; clear tmr1l 0015 018f 0070 clrf tmr1h ; clear tmr1h 0016 0195 0071 clrf ccpr1l ; clear ccpr1l 0017 0196 0072 clrf ccpr1h ; clear ccpr1h 0018 1409 0073 bsf port_e,0 ; set init high on ranging module 0019 1410 0074 bsf t1con,0 ; enable tmr1 001a 21f3 0075 call del_9 ; delay 0.9 msec for transducer to stabilize 001b 1489 0076 bsf port_e,1 ; enable transducer to receive (binh) 001c 0077 chk_t1 001c 190c 0078 btfsc pir1,2 ; check for capture 001d 2822 0079 goto chk_done ; jump if capture 001e 1c0c 0080 btfss pir1,0 ; check for tmr1 overflow 001f 281c 0081 goto chk_t1 ; loop if nothing happened 0020 1010 0082 bcf t1con,0 ; turn off tmr1 0021 2833 0083 goto ovr_flo ; capture event did not occur 0022 0084 chk_done 0085 ; 0086 ; calculate distance to 0.5 inch resolution 0087 ; 0022 1010 0088 bcf t1con,0 ; turn off tmr1 0023 0815 0089 movf ccpr1l,w ; move lsb into w 0024 00a2 0090 movwf accblo ; move lsb into accblo 0025 0816 0091 movf ccpr1h,w ; move msb into w 0026 00a3 0092 movwf accbhi ; move msb into accbhi 0027 304a 0093 movlw 0x4a ; move 75usec/0.50in into w 0028 00a0 0094 movwf accalo ; move lsb into accalo 0029 01a1 0095 clrf accahi ; clear msb (accahi) 002a 208f 0096 call d_divf ; call 16-bit/8-bit routine 0097 ; which is described in 0098 ; application note 544 002b 3025 0099 movlw 0x25 ; check remainder to see if 002c 0224 0100 subwf accclo,w ; we should round up... 002d 1803 0101 btfsc status,carry ; if remainder < (0.5 * divisor), skip 002e 0aa2 0102 incf accblo,f ; round up 002f 1903 0103 btfsc status,z ; check low byte for wrap around 0030 0aa3 0104 incf accbhi,f ; if lsb wrapped, increment high byte 0031 1d03 0105 btfss status,z ; check high byte for wrap around 0032 2835 0106 goto done ; high byte didn't wrap 0033 0107 ovr_flo 0033 01a2 0108 clrf accblo 0034 01a3 0109 clrf accbhi 0035 0110 done 0035 21fd 0111 call del_100 ; wait 100 msec before clearing hw. 0036 1009 0112 bcf port_e,0 ; disable init 0037 1089 0113 bcf port_e,1 ; disable binh 0038 21fd 0114 call del_100 ; wait 100 msec before enabling hw. 0039 2812 0115 goto xdcr 0116 0120 0149 0150 end 0151 memory usage map ('x' = used, '-' = unused) 0000 : xxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxx xxxxxxxxxx------ 0040 : ---------------- ---------------- ---------------- ---------------- all other memory blocks unused. errors : 0 warnings : 0 messages : 0
ds00597a-page 8 1995 microchip technology inc. w orldwide s ales & s ervice americas (continued) san jose microchip technology inc. 2107 north first street, suite 590 san jose, ca 95131 tel: 408 436-7950 fax: 408 436-7955 asia/pacific hong kong microchip technology inc. unit no. 3002-3004, tower 1 metroplaza 223 hing fong road kwai fong, n.t. hong kong tel: 852 2 401 1200 fax: 852 2 401 3431 korea microchip technology korea 168-1, youngbo bldg. 3 floor samsung-dong, kangnam-ku, seoul, korea tel: 82 2 554 7200 fax: 82 2 558 5934 singapore microchip technology inc. 200 middle road #10-03 prime centre singapore 0718 tel: 65 334 8870 fax: 65 334 8850 taiwan microchip technology taiwan 10f-1c 207 tung hua north road taipei, taiwan, roc tel: 886 2 717 7175 fax: 886 2 545 0139 europe united kingdom arizona microchip technology ltd. unit 6, the courtyard meadow bank, furlong road bourne end, buckinghamshire sl8 5aj tel: 44 0 1628 851077 fax: 44 0 1628 850259 france arizona microchip technology sarl 2 rue du buisson aux fraises 91300 massy - france tel: 33 1 69 53 63 20 fax: 33 1 69 30 90 79 germany arizona microchip technology gmbh gustav-heinemann-ring 125 d-81739 muenchen, germany tel: 49 89 627 144 0 fax: 49 89 627 144 44 italy arizona microchip technology srl centro direzionale colleoni palazzo pegaso ingresso no. 2 via paracelso 23, 20041 agrate brianza (mi) italy tel: 39 039 689 9939 fax: 39 039 689 9883 japan microchip technology intl. inc. benex s-1 6f 3-18-20, shin yokohama kohoku-ku, yokohama kanagawa 222 japan tel: 81 45 471 6166 fax: 81 45 471 6122 americas corporate of?e microchip technology inc. 2355 west chandler blvd. chandler, az 85224-6199 tel: 602 786-7200 fax: 602 786-7277 atlanta microchip technology inc. 500 sugar mill road, suite 200b atlanta, ga 30350 tel: 404 640-0034 fax: 404 640-0307 boston microchip technology inc. five the mountain road, suite 120 framingham, ma 01701 tel: 508 820-3334 fax: 508 820-4326 after july 31, 1995: tel: 508 480-9990 fax: 508 420-8575 chicago microchip technology inc. 333 pierce road, suite 180 itasca, il 60143 tel: 708 285-0071 fax: 708 285-0075 dallas microchip technology inc. 14651 dallas parkway, suite 816 dallas, tx 75240-8809 tel: 214 991-7177 fax: 214 991-8588 dayton microchip technology inc. 35 rockridge road englewood, oh 45322 tel: 513 832-2543 fax: 513 832-2841 los angeles microchip technology inc. 18201 von karman, suite 455 irvine, ca 92715 tel: 714 263-1888 fax: 714 263-1338 new york microchip technology inc. 150 motor parkway, suite 416 hauppauge, ny 11788 tel: 516 273-5305 fax: 516 273-5335 *information contained in this publication regarding device applications and the like is intended by way of suggestion only. no representation of warranty is given and no liability is assumed by microchip technology inc. with respect to the accuracy or use of such information. use of microchips products as critical components in life support systems is not authorized except with express written approval by microchip. the microchip logo and name are trademarks of microchip technology incorporated. all rights reserved. all other trademarks mentioned herein are the property of their respective companies. printed in the usa, 6/6/95 1995, microchip technology inc.


▲Up To Search▲   

 
Price & Availability of AN597

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X